package com.yydm.serviceedu.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 汽车产品
 * </p>
 *
 * @author yydm
 * @since 2022-06-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Product对象", description = "汽车产品")
public class Automobile implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "汽车名称")
    private String productName;

    @ApiModelProperty(value = "汽车级别")
    private String productCategory;

    @ApiModelProperty(value = "创始人Id")
    private Integer founderId;

    @ApiModelProperty(value = "汽车价格")
    private String productPrice;

    @ApiModelProperty(value = "汽车销量")
    private Integer productSales;

    @ApiModelProperty(value = "汽车个数")
    private Integer productQuantity;

    @ApiModelProperty(value = "汽车描述")
    private String productDescribe;

    @ApiModelProperty(value = "汽车图片")
    private String fileName;

    @ApiModelProperty(value = "创建时间")
//    自动填充
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

}
